<div class="w100100">
    <div class="title"><?=$co_buywhere['titlemenu'.$hg]?></div>
    <div class="contact-detail buy-where">       
		<ul>
			<?php
			$i = 0;
			require_once ("library/paging.cls.php");
			$paging = new paging();
			$curpg = $_GET['var2'];
			$curpg = (isset($curpg)) ? $curpg : 1;
			$gotopage = APPLICATION_URL . "buy-where";
			$perpage = 6;
			$pagecount = 6;

			$sql = "select * from buy_where_item   ";

			$query = $db->select($sql);
			$totalrows = $db->numrows($query);

			$sql_list = "select * from buy_where_item  order by orderId, id desc limit " . (($curpg - 1) * $perpage) . ", " . $perpage;
			$qr_list = $db->select($sql_list);
			$num_list = $db->numrows($qr_list);

			while ($tt_list = $db->fetch($qr_list)) {
				$i++;
				if ($i != $num_list)
					$listborder = " border-bottom:#d7d7d7 1px dotted; ";
				else
					$listborder = "";
				?>
			
				<li>
					<a href="<?= $tt_list['content'] ?>" target="_blank">
						<img src="<?=APPLICATION_URL?>where-img/<?= $tt_list['image'] ?>" alt="<?= $tt_list['title'.$hg] ?>">
					</a>
				</li>
			<?php } ?>
        
		</ul>
		<div class="clear"></div>
		<div class="paging"><?php echo $paging->pagenew($totalrows, $perpage, $pagecount, $curpg, $gotopage, "", "titlepage"); ?></div>
    </div>

</div>
